]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
view-selector: Remove show/hide functions
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 12 Feb 2011 22:03:56 +0000 (23:03 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 16 Feb 2011 18:58:21 +0000 (19:58 +0100)
As Main.overview is now usable from the view selector's constructor,
move the setup of signal connections there and remove the show/hide
methods which were used as workaround.

https://bugzilla.gnome.org/show_bug.cgi?id=642196

js/ui/overview.js
js/ui/viewSelector.js

index 2f6c6abddf0776c699ab821823524e98a36b294a..843d8f2802d848f4b4ad81f5f6f2f6f51e5e0ffc 100644 (file)
@@ -535,7 +535,6 @@ Overview.prototype = {
         this._group.show();
         this._background.show();
 
-        this.viewSelector.show();
         this._workspacesDisplay.show();
 
         this.workspaces = this._workspacesDisplay.workspacesView;
@@ -749,7 +748,6 @@ Overview.prototype = {
         this.workspaces = null;
 
         this._workspacesDisplay.hide();
-        this.viewSelector.hide();
 
         this._desktopFade.hide();
         this._background.hide();
index 636994ccc12f18516a97cc7f8bba1242e4824d70..3e1f21034cdb127a7359a59f0c0f4aca99edb3b2 100644 (file)
@@ -350,6 +350,8 @@ ViewSelector.prototype = {
     _init : function() {
         this.actor = new St.BoxLayout({ name: 'viewSelector',
                                         vertical: true });
+        this.actor.connect('key-press-event',
+                           Lang.bind(this, this._onKeyPress));
 
         // The tab bar is located at the top of the view selector and
         // holds both "normal" tab labels and the search entry. The former
@@ -392,9 +394,12 @@ ViewSelector.prototype = {
                 this._switchTab(this._activeTab);
             }));
 
-        this._keyPressId = 0;
-        this._itemDragBeginId = 0;
-        this._overviewHidingId = 0;
+        Main.overview.connect('item-drag-begin',
+                              Lang.bind(this, this._switchDefaultTab));
+        Main.overview.connect('showing',
+                              Lang.bind(this, this._switchDefaultTab));
+        Main.overview.connect('hiding',
+                              Lang.bind(this, this._switchDefaultTab));
 
         // Public constraints which may be used to tie actors' height or
         // vertical position to the current tab's content; as the content's
@@ -571,37 +576,6 @@ ViewSelector.prototype = {
 
     addSearchProvider: function(provider) {
         this._searchTab.addSearchProvider(provider);
-    },
-
-    show: function() {
-        if (this._itemDragBeginId == 0)
-            this._itemDragBeginId = Main.overview.connect('item-drag-begin',
-                                                          Lang.bind(this, this._switchDefaultTab));
-        if (this._overviewHidingId == 0)
-            this._overviewHidingId = Main.overview.connect('hiding',
-                                                           Lang.bind(this, this._switchDefaultTab));
-        if (this._keyPressId == 0)
-            this._keyPressId = this.actor.connect('key-press-event',
-                                                  Lang.bind(this, this._onKeyPress));
-
-        this._switchDefaultTab();
-    },
-
-    hide: function() {
-        if (this._keyPressId > 0) {
-            this.actor.disconnect(this._keyPressId);
-            this._keyPressId = 0;
-        }
-
-        if (this._itemDragBeginId > 0) {
-            Main.overview.disconnect(this._itemDragBeginId);
-            this._itemDragBeginId = 0;
-        }
-
-        if (this._overviewHidingId > 0) {
-            Main.overview.disconnect(this._overviewHidingId);
-            this._overviewHidingId = 0;
-        }
     }
 };
 Signals.addSignalMethods(ViewSelector.prototype);